package io.iamting93.email.controller;

import io.iamting93.email.service.EmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author boting.guo
 * @date 2021/11/30 16:13
 */

@RestController
public class EmailController {

    @Autowired
    private EmailService emailService;

    @GetMapping("/{email}/{code}")
    public boolean sendEmail(@PathVariable("email") String email,
                             @PathVariable("code") String code) {
        return emailService.sendEmail(email, "作业验证码", code);
    }
}
